<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>复写代码</title>
</head>
<body>
<input type="button" value="获取时间" onclick="getDate()">
<input type="text" id="date"><br>
<input type="text" id="txt1" value="aa ">
<input type="text" name="txt1" value="b ">
<input type="text" name="txt1" value="c ">
<input type="button" value="修改文本" onclick="setTxt1()"><br>
<script>
function getDate() {
    document.getElementById("date").value=Date();

    console.log(Date());
}
    var txt2=document.getElementById("txt1");
       console.log(document.getElementById("txt1").value);
    function getTxt1() {
        console.log(document.getElementById("txt1").value);
    }
    function setTxt1() {
        document.getElementById("txt1").value='99999999';
    }
    function addT(a,b) {
        return a+b;
    }
        console.log(addT(1,2));
    var result=100;
    function foradd(a,b) {


        if(a==3){
            result=3 ;
        }else{
            result=a;
            for(var i=a;i<a+b;i++){
                console.log(i);
                result=result+1;
            }
        }
        return result;


    }
    console.log(foradd(1,3));
    console.log(result);

    var arr1=document.getElementsByName("txt1");
    console.log(arr1[0].innerHTML);
    //3
    //    document.getElementsByTagName();
    var myjava=new Array();
    myjava[0]="spring";
    myjava[1]="struts";
    myjava[2]="hibernate";
    console.log(myjava);
    //var myjava=new Array("a","b","c");
   // var myjava=["a","b","c"];
    console.log(myjava.indexOf("b"));

</script>

</body>
</html>